<%@page import="chances.system.operator.entity.MgmtInfo"%>
<%@page import="chances.system.operator.service.MgmtInfoService"%>
<%@page import="org.springframework.web.context.support.WebApplicationContextUtils"%>
<%@page import="org.springframework.context.ApplicationContext"%>
<%@ page language="java" contentType="text/html; charset=utf-8"	pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
<%@ taglib uri="http://www.springframework.org/tags" prefix="spring" %>
<!DOCTYPE html>

<c:set var="contextPath" value="${pageContext.request.contextPath}"	scope="request"/>
<spring:eval expression="@config['cms.picture']" var="cmsPicPath" scope="application"/>
<spring:eval expression="@config['cms.template']" var="cmsTemplatePath" scope="application"/>
<spring:eval expression="@config['site.picture']" var="sitePicPath" scope="application"/>

<%
	ServletContext context = request.getSession().getServletContext();
	ApplicationContext ctx = WebApplicationContextUtils.getWebApplicationContext(context);
	MgmtInfoService mgmtInfoService = (MgmtInfoService)ctx.getBean("mgmtInfoService");
	MgmtInfo mgmtInfo = mgmtInfoService.findFirstOrDeFault();
	application.setAttribute("mgmtInfo", mgmtInfo);
	session.setAttribute("path", application.getRealPath("/"));
%>
<html>
	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width, initial-scale=1.0,maximum-scale=1.0,user-scalable=no">
		<title>${mgmtInfo.title}</title>
		<link rel="shortcut icon" href="${contextPath}${sitePicPath}/${mgmtInfo.favicon}" type="image/x-icon">
		<link href="${contextPath}/css/bootstrap.min.css" rel="stylesheet">
		<link href="${contextPath}/font-awesome/css/font-awesome.css" rel="stylesheet">
		<link href="${contextPath}/css/animate.css" rel="stylesheet">
		<link href="${contextPath}/css/plugins/ladda/ladda-themeless.min.css" rel="stylesheet">
		<link href="${contextPath}/css/plugins/tabs/bootstrap.addtabs.css"	rel="stylesheet">
		<link href="${contextPath}/css/app.css" rel="stylesheet">
		<link href="${contextPath}/css/style.css" rel="stylesheet">
		
		<!-- Mainly scripts -->
		<script src="${contextPath}/js/jquery-2.1.1.js"></script>
		<script src="${contextPath}/js/bootstrap.min.js"></script>
		<script src="${contextPath}/js/jquery.serialize-object.min.js"></script>
		<script src="${contextPath}/js/plugins/metisMenu/jquery.metisMenu.js"></script>
		<script	src="${contextPath}/js/plugins/slimscroll/jquery.slimscroll.min.js"></script>
		<!-- Custom and plugin javascript -->
		<script src="${contextPath}/js/plugins/pace/pace.min.js"></script>
		<script src="${contextPath}/js/plugins/chosen/chosen.jquery.js"></script>
		<script src="${contextPath}/js/plugins/toastr/toastr.min.js"></script>
		<script src="${contextPath}/js/plugins/tabs/bootstrap.addtabs.min.js"></script>
		<script	src="${contextPath}/js/plugins/dataTables/jquery.dataTables.min.js"></script>
		<script src="${contextPath}/js/inspinia.js"></script>
		<script src="${contextPath}/js/vue.js"></script>
		
		<script type="text/javascript">
		    $(function () {
		        $('#tabs').addtabs({contextmenu:true});
		    });

			function addTabs(ids,titles,urls){
		 		Addtabs.add({
		            id: ids,
		            title: titles,
		            url: urls,
		            ajax: false
		        });

	        	$('#tabs li a').off("click");            	
	        	$('#tabs li a').on("click", function(){
	            	autoLocateNavItem($(this).closest('li').attr("id"));
	            });
	        	autoLocateNavItem(ids);
		   	}
	
			function refreshTopInfoArea(){
				topInfoArea.refresh();
			}
	
			var indexPieInterval = null;
		</script>
	</head>
	<body>
		<!-- navigation  -->
		<div id="wrapper">
			<jsp:include page="nav.jsp" />
			<div id="page-wrapper" class="gray-bg">
				<div class="row border-bottom">
					<jsp:include page="header.jsp" />
				</div>
				<div class="row wrapper border-bottom  page-heading">
					<div id="tabs">
						<!-- Nav tabs -->
						<ul class="nav nav-tabs" role="tablist"></ul>
						<div class="wrapper wrapper-content tab-content" style="padding:10px 0"></div>
					</div>
				</div>
				<!-- Tab panes -->
				
				<div class="footer">
					<jsp:include page="footer.jsp"></jsp:include>
				</div>
			</div>
		</div>
	</body>
</html>